/********************************************************
	Syntax for Tables OA2-OA6
	including lincom results
*********************************************************/

/******************************
Experiment 1
******************************/

clear
cd "C:\Users\Joshua\OneDrive\Documents\Work - Finished\BJPS - Comp Explanations\Dataverse"
use exp1_cleaned.dta

recode cond_info (4 5 6 = 4), gen(treat)
label var treat "Treatment"
label def jj 1 "No Information Baseline" 2 "No Justification" 3 "Justification" 4 "Justification w/Counter", replace
label values treat jj

label def upd 1 "No Information Baseline" 2 "No Justification" 3 "Justification" 4 "Teacher Counter" 5 "Non-Partisan Counter" 6 "Partisan Counter"
label values cond_info upd

****Model
eststo clear
*Figure 1
eststo: regress therm01 ib3.treat i.cond_party
*Figure 2
eststo: regress therm01 ib3.cond_info i.cond_party
*Figure 3
eststo: regress therm01 ib3.cond_info##i.cond_party1

***Table
esttab using table_oa2.rtf, replace onecell  nobaselevels ///
	b(2) se ar2 star(+ 0.1 * 0.05 ** 0.01) ///
	mtitles("Figure 1" "Figure 2" "Figure 3") ///
	title("{\b Table OA2}: Experiment 1 Models") label
	
	
eststo clear

/******************************
Experiment 2
******************************/

clear
use exp2_cleaned.dta

recode treat_expl (1 = 1 "No Justification") (2 = 2 "Justification") (3 4 = 3 "Just. w/Counter"), gen(treat1)

label def expj 1 "No Justification" 2 "Justification" 3 "HC Counter" 4 "LC Counter" 
label values treat_expl expj

****Models
eststo clear
***Figure 1
*controls
eststo: regress therm_post01 ib2.treat1 i.treat_party therm_pre01
*no controls
eststo: regress therm_post01 ib2.treat1 i.treat_party 
**Figure 2
eststo: regress therm_post01 ib2.treat_expl i.treat_party therm_pre01
eststo: regress therm_post01 ib2.treat_expl i.treat_party
*Figure 3
eststo: regress therm_post01 ib2.treat_expl##i.copartisan therm_pre01
eststo: regress therm_post01 ib2.treat_expl##i.copartisan 
		
***Table
esttab using table_oa3.rtf, replace onecell  nobaselevels ///
	b(2) se ar2 star(+ 0.1 * 0.05 ** 0.01) ///
	mtitles("Fig 1 (In-Text)" "Fig 1 (No Control)" "Fig 2 (In-Text)" "Fig 2 (No Control)" "Fig 3 (In-Text)" "Fig 3 (No Control)") ///
	title("{\b Table OA3}: Experiment 2 Models") label ///
	addnotes("Baseline Categories: Justification (all models); Democratic Legislator (model 2); Co-Partisan legislator (model 3)")
	
eststo clear

/******************************
Experiment 3
******************************/

clear
use exp3_cleaned.dta

*********Exp 3a
recode gil_exp (1 = 1 "No Justification") (2 = 2 "Justification")  (3 4 = 3 "Just. w/Counter") , gen(treat)

label def gej 1 "No Justification" 2 "Justification" 3 "LW Counter" 4 "RW Counter" 
label values gil_exp gej

**********Exp 3b
recode corker_exp (1 = 1 "No Justification") (2 = 2 "Justification")  (3 4 = 3 "Just. w/Counter") , gen(treat2)
label values corker_exp gej

*********Figure 1
eststo clear
eststo: regress gil_post01 ib2.treat 
eststo: regress gil_post01 ib2.treat i.gil_pre i.gil_partisan i.gil_prox i.treat_order

****Corker
eststo: regress corker_post01 ib2.treat2 
eststo: regress corker_post01 ib2.treat2 i.corker_pre i.corker_partisan i.corker_prox i.treat_order

****Table
esttab using table_oa4.rtf, replace onecell  nobaselevels ///
	b(2) se ar2 star(+ 0.1 * 0.05 ** 0.01) ///
	mtitles("Gillibrand" "Gillibrand" "Corker" "Corker") ///
	title("{\b Table OA4}: Experiment 3 Models, Figure 1 Analyses") label ///
	addnotes("Baseline Categories: Justification (all models); Favorable Prior; Gained Proximity; Co-Paritsan; Corker First")
	

*********Figure 2
eststo clear
eststo: regress gil_post01 ib2.gil_exp 
eststo: regress gil_post01 ib2.gil_exp i.gil_pre i.gil_partisan i.gil_prox i.treat_order
eststo: regress corker_post01 ib2.corker_exp 
eststo: regress corker_post01 ib2.corker_exp i.corker_pre i.corker_partisan i.corker_prox i.treat_order

esttab using table_oa5.rtf, replace onecell  nobaselevels ///
	b(2) se ar2 star(+ 0.1 * 0.05 ** 0.01) ///
	mtitles("Gillibrand" "Gillibrand" "Corker" "Corker") ///
	title("{\b Table OA5}: Experiment 3 Models, Figure 2 Analyses") label ///
	addnotes("Baseline Categories: Justification (all models); Favorable Prior; Gained Proximity; Co-Paritsan; Corker First")
	

*********Figure 3
eststo clear
eststo: regress gil_post01 ib2.gil_exp##i.gil_partisan 
eststo: regress gil_post01 ib2.gil_exp##i.gil_partisan i.gil_pre i.gil_prox i.treat_order
eststo: regress corker_post01 ib2.corker_exp##i.corker_partisan 
eststo: regress corker_post01 ib2.corker_exp##i.corker_partisan i.corker_pre  i.corker_prox i.treat_order

esttab using table_oa6.rtf, replace onecell  nobaselevels ///
	b(2) se ar2 star(+ 0.1 * 0.05 ** 0.01) ///
	mtitles("Gillibrand" "Gillibrand" "Corker" "Corker") ///
	title("{\b Table OA6}: Experiment 3 Models, Figure 4 Analyses") label ///
	addnotes("Baseline Categories: Justification (all models); Favorable Prior; Gained Proximity; Co-Paritsan; Corker First")
	



	